//
//  OKSickModel.m
//  ZLFastDoctor
//
//  Created by answer on 16/5/22.
//  Copyright © 2016年 LS. All rights reserved.
//

#import "OKSickModel.h"
#import "LSAPIManager.h"
#import <YYModel/YYModel.h>
#import "OKSickComplicationModel.h"
#import "OKDoctorModel.h"
#import "OKDoctorInfoModel.h"

@implementation OKSickModel

+ (void)requestSickSegmentWithParams:(id)params completion:(void(^)(NSArray *))completion {
    [[LSAPIManager sharedManager] requestSickSegment:nil parameters:params Completion:^(id responseObject, NSError *error) {
        
            NSArray *data = responseObject[@"data"];
            NSArray *result = [NSArray yy_modelArrayWithClass:[OKSickModel class] json:data];
            completion(result);
        
    }];
}

+ (void)requestSickComplicationWithParams:(id)params completion:(void(^)(NSArray *))completion {
    [[LSAPIManager sharedManager] requestSickComplication:nil parameters:params Completion:^(id responseObject, NSError *error) {
        NSArray *data = responseObject[@"data"];
        NSArray *result = [NSArray yy_modelArrayWithClass:[OKSickComplicationModel class] json:data];
        completion(result);
    }];
}

+ (void)requestDoctorWithParams:(id)params completion:(void(^)(NSArray *))completion {
    [[LSAPIManager sharedManager] requestDoctor:nil parameters:params Completion:^(id responseObject, NSError *error) {
        NSArray *data = responseObject[@"data"];
        NSArray *result = [NSArray yy_modelArrayWithClass:[OKDoctorModel class] json:data];
        completion(result);
    }];
}

+ (void)requestDoctorInfoWithParams:(id)params completion:(void(^)(OKDoctorInfoModel *))completion {
    
    [[LSAPIManager sharedManager] requestDoctorInfo:nil parameters:params Completion:^(id responseObject, NSError *error) {
        
        NSDictionary *data = responseObject[@"data"];
        //NSLog(@"%@", data);
        OKDoctorInfoModel *model = [OKDoctorInfoModel yy_modelWithJSON:data];
        completion(model);
    }];
}


@end





